package com.shop.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shop.agentDataImpl.ShopWindowDataEnum;
import com.shop.agentDataImpl.ShopWindowDataServer;
import com.shop.common.BeanUtil;
import com.shop.common.ObjectUtil;
import com.shop.common.result.Result;
import com.shop.common.result.util.ResultModel;
import com.shop.entity.ShopWindowDo;
import com.shop.mapper.ShopWindowDoMapper;
import com.shop.service.ShopWindowService;
import com.shop.vo.SelectShopWindowVo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 橱窗表 服务实现类
 * </p>
 *
 * @author 靳 旺
 * @since 2021-03-13
 */
@Service
public class ShopWindowServiceImpl extends ServiceImpl<ShopWindowDoMapper, ShopWindowDo> implements ShopWindowService {

    @Override
    public ResultModel selectShopWindow(SelectShopWindowVo selectShopWindowVo) throws Exception {
        ShopWindowDo shopWindowDo = new ShopWindowDo();
        ObjectUtil.annotationToObject(selectShopWindowVo, shopWindowDo);
        shopWindowDo.setIsDel("N");
        ShopWindowDataServer shopWindowDataServer = BeanUtil.getBeanByBeanName(ShopWindowDataEnum.getImplByCode(selectShopWindowVo.getBeanName()), ShopWindowDataServer.class);
        List<Object> selectShopWindowDtos = shopWindowDataServer.getClientShopWindowData(shopWindowDo);
        return Result.successResultModel(selectShopWindowDtos);
    }


}
